package com.ls.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author TangQuanBin
 * @since 2019-09-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysPermission extends Model<SysPermission> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "permission_id", type = IdType.AUTO)
    private Long permissionId;

    /**
     * 菜单id
     */
    private Long menuId;

    /**
     * 父id 为
     */
    private Long parentId;

    /**
     * 权限名称
     */
    private String permissionName;

    /**
     * 权限对应URL编号
     */
    private String sn;

    /**
     * 权限对应的url(shiro框架用
     */
    private String resources;

    /**
     * 状态（0-可用；1-不可用）
     */
    private Integer status;

    /**
     * 子权限
     */
    @TableField(exist = false)
    private List<SysPermission> children;


    @Override
    protected Serializable pkVal() {
        return this.permissionId;
    }

}
